    /*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package filemaker;

import NodeManager.Node;
import NodeManager.NodeManager;
import NodeManager.NodeFile;
import java.io.File;
import java.util.Vector;

/**
 *
 * @author Sean
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        try {

            // TODO need to ensure multiple nodes don't have the same direcory

            // Create 3 Nodes.
            Node node1 = new Node("Node1", new File("C:\\Nodes" + File.separatorChar + "Node1"));
            Node node2 = new Node("Node2", new File("C:\\Nodes" + File.separatorChar + "Node2"));
            Node node3 = new Node("Node3", new File("C:\\Nodes" + File.separatorChar + "Node3"));
            // Add all 3 nodes to a Node Collection
            NodeManager nodeManager = new NodeManager(node1, node2, node3);

            // Create some random files, and save them in a temp folder.
            MakeFile make = new MakeFile();
            Vector<File> files = make.CreateRandomFiles("C:\\Nodes" + File.separatorChar + "Temp", 10);
            for (File file : files) {
                // Using the NodeManager, add each file to 2 out of the 3 nodes:
                nodeManager.AddFile(file);
            }

            // Get all files that are stored around the 3 nodes.
            Vector<NodeFile> AllFiles = nodeManager.GetAllNodeFiles();
            for (NodeFile NodeFile : AllFiles) {
                System.out.println("Filename: " + NodeFile.FileName + ", FirstNode: " +
                        NodeFile.FirstNode.NodeName + ", SecondNode: " +
                        NodeFile.SecondNode.NodeName);
            }

            // Write the Nodes to an output stream
            nodeManager.GetRdfModel().write(System.out);

        } catch (Exception ex) {
            ex.printStackTrace(System.out);
        }
    }
}
